package com.ai.consumer.controller;

import com.ai.consumer.model.Consumer;
import com.ai.consumer.service.ConsumerService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * Date:  2018/11/1
 * Time:  14:24
 * Email: siy@hmgsoft.com
 * Created by siy
 */
@RestController
@RequestMapping("/v1")
public class ConsumerController {

    @Resource
    private ConsumerService consumerService;

    @GetMapping("/sel")
    public String sel(){
        Consumer qs = new Consumer();
        qs.setTCount(100);
        Consumer rs = consumerService.sel(qs);
        System.out.println(rs);
        return "ok";
    }

    @GetMapping("/selAll")
    public String selAll(){
        Consumer qs = new Consumer();
        qs.setTCount(100);
        List<Consumer> rs = consumerService.selAll(qs);
        System.out.println(rs);
        return "ok";
    }

    @GetMapping("/add")
    public String add(){
        Consumer qs = new Consumer();
        qs.setTCount(888);
        consumerService.add(qs);
        return "ok";
    }
}
